<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('blog_article_actions', function (Blueprint $table) {
            $table->id();
            $table->integer('article_id')->comment('文章ID');
            $table->string('ip')->comment('操作人IP');
            $table->char('type')->comment('类型:view=浏览,like=点赞,comment=评论');
            $table->string('comment_content')->nullable()->comment('评论内容');
            $table->timestamps();
            $table->softDeletes();
            $table->comment('【博客】操作表');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('blog_article_actions');
    }
};
